#include "VEnginePCH.h"
#if 0
#include "..\inc\ucomctrl.h"

UComCtrl::UComCtrl(void)
{
}

UComCtrl::~UComCtrl(void)
{
}

//////////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////////
UIMP_CLASS(UStatic, VUIControl);
void UStatic::StaticInit()
{
	UREG_PROPERTY("text", UPT_STRINGW, UFIELD_OFFSET(UStatic, m_strText));
	UREG_PROPERTY("textAlign", UPT_INT, UFIELD_OFFSET(UStatic, m_TextAlign));
	UREG_PROPERTY("TextColor", UPT_COLOR, UFIELD_OFFSET(UStatic, m_TextFontColor));
}
BOOL UStatic::OnCreate()
{	
	switch(m_TextAlign)
	{
	case 0:
		m_eTextAlign = UITA_LEFT;
		break;
	case 1:
		m_eTextAlign = UITA_RIGHT;
		break;
	case 2:
		m_eTextAlign = UITA_CENTER;
	    break;	
	default:
	    break;
	}
	return VUIControl::OnCreate();
}
UStatic::UStatic()
{
	//m_eTextAlign = UITA_LEFT;
	m_TextAlign = 0;
	m_TextFontColor.Set(255, 255, 255, 255);
}

UStatic::~UStatic()
{
}

void UStatic::SetText(const char* pszText)
{
	m_strText.Set(pszText);
}

void UStatic::SetText(const WCHAR* pszwText)
{
	m_strText.Set(pszwText);
}

const WCHAR* UStatic::GetText() const
{
	return m_strText.GetBuffer();
}

void UStatic::OnRender(const VPoint& offset, const VRect &updateRect)
{
	if (!m_strText.Empty() && m_Style->m_spFont)
	{
		UDrawText(sm_UiRender, m_Style->m_spFont, offset, m_Size, m_TextFontColor, m_strText.GetBuffer(), m_eTextAlign);
	}
}
//////////////////////////////////////////

UIMP_CLASS(UButtonStatic, UStatic);

void UButtonStatic::StaticInit()
{	
}
UButtonStatic::UButtonStatic():colorType(9)
{
}
UButtonStatic::~UButtonStatic()
{
}
void UButtonStatic::OnMouseDown(const VPoint& pt, UINT nClickCnt, UINT uFlags)
{
	GetParent()->OnMouseDown(pt,nClickCnt,uFlags);
}

void UButtonStatic::OnMouseEnter(const VPoint& pt, UINT uFlags)
{
	GetParent()->OnMouseEnter(pt, uFlags);
}

void UButtonStatic::OnMouseLeave(const VPoint& pt, UINT uFlags)
{
	GetParent()->OnMouseLeave(pt, uFlags);
}

void UButtonStatic::OnMouseUp(const VPoint& pt, UINT uFlags)
{
	GetParent()->OnMouseUp(pt, uFlags);
}

void UButtonStatic::OnRightMouseDown(const VPoint& position, UINT nRepCnt, UINT flags)
{
	GetParent()->OnRightMouseDown(position, nRepCnt, flags);
}

void UButtonStatic::OnRightMouseUp(const VPoint& position, UINT flags)
{
	GetParent()->OnRightMouseUp(position, flags);
}

void UButtonStatic::OnRightMouseDragged(const VPoint& position, UINT flags)
{
	GetParent()->OnRightMouseDragged(position, flags);
}

BOOL UButtonStatic::DrawTooltip(const VPoint& cursorPos)
{	
	return GetParent()->DrawTooltip(cursorPos);
}

void UButtonStatic::OnRender(const VPoint& offset, const VRect &updateRect)
{
	if(GetText())
	{
		switch(colorType)
		{		
		case 0:
			m_TextColor = LCOLOR_RGB(235, 235, 235);
			break;
		case 1:
			m_TextColor = LCOLOR_RGB(255, 0, 0);
			break;
		case 2:
			m_TextColor = LCOLOR_RGB(6, 255, 0);
			break;
		case 3:
			m_TextColor = LCOLOR_RGB(255, 255, 255);
			break;
		case 4:
			m_TextColor = LCOLOR_RGB(255, 232, 151);
			break;
		case 5:
			m_TextColor = LCOLOR_RGB(7, 229, 195);
			break;
		default:
			break;
		}
		UDrawText(sm_UiRender, m_Style->m_spFont, offset, m_Size, m_TextFontColor, m_strText.GetBuffer(), m_eTextAlign);
	}
}

#endif 